<body>
<div class="layui-fluid">
	<div class="layui-row layui-col-space15">
		<div class="layui-col-md12">
			<div class="layui-card">
				<div class="layui-card-header">{$table_info.name}&nbsp;&nbsp;&nbsp;{$page_name}</div>
				<div class="layui-card-body" pad15>
<form action="{:url(request()->action())}" method="post">
					<div class="layui-form">
					{if $info.id > 0}
						<div class="layui-form-item">
							<label class="layui-form-label">名称</label>
							<div class="layui-input-inline wy-input-show-text">
								{$info.field_name}
							</div>
							<div class="layui-form-mid layui-word-aux"></div>
						</div>
					{else/}
					<input type="hidden" name="field_name" value="{$info.field_name}">
					{/if}
						<div class="layui-form-item">
							<label class="layui-form-label">别名</label>
							<div class="layui-input-inline">
								<input type="text" class="layui-input" name="cname" autocomplete="off" value="{$info.cname}" lay-verify="required" placeholder="请输入别名">
							</div>
							<div class="layui-form-mid layui-word-aux"></div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label">分组</label>
							<div class="layui-input-inline" >
								<select name="type_group_id">
									{foreach $type_group as $key=>$vo }
										{if in_array($info['field_name'],array('seo_title','seo_keywords','seo_description')) && $key == 99}
											<option value="{$key}" {if $info.type_group_id == strval($key)} selected {/if}>{$vo}</option>
										{elseif !in_array($info['field_name'],array('seo_title','seo_keywords','seo_description')) && $key != 99}
											<option value="{$key}" {if $info.type_group_id == strval($key)} selected {/if}>{$vo}</option>
										{/if}
									{/foreach}
								</select>
							</div>
							<div class="layui-form-mid layui-word-aux"></div>
						</div>
					{if $info.id == 0}
						<div class="layui-form-item">
							<label class="layui-form-label">类型</label>
							<div class="layui-input-inline" >
								<select name="type" lay-verify="required" lay-filter="type">
									<option value="">--请选择--</option>
									{volist name="field_type" id="vo"}
									<optgroup label="{$vo.name}">
										{volist name="vo.lists" id="vv"}
											<option value="{$vv.field}" {if $info.type == $vv.field} selected {/if}>{$vv.name}</option>
										{/volist}
									</optgroup>
									{/volist}
								</select>
							</div>
							<div class="layui-form-mid layui-word-aux"></div>
						</div>
						
					{else/}
						<div class="layui-form-item">
							<label class="layui-form-label">类型</label>
							<div class="layui-input-inline wy-input-show-text" >
								{$field_language[$info['type']]}
								<input type="hidden" name="type" value="{$info['type']}">
							</div>
						</div>
					{/if}
						
						
						<div class="layui-form-item" id="attr_type" style="display:none;">
							<label class="layui-form-label">选择类型</label>
							<div class="layui-input-inline" >
								<select name="attr_type">
									{volist name="attr_type" id="vo"}
										<option value="{$vo.type}" {if $info.attr_type == $vo.type} selected {/if}>{$vo.name}</option>
									{/volist}
								</select>
							</div>
							<div class="layui-form-mid layui-word-aux"></div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label">排序</label>
							<div class="layui-input-inline">
								<input type="text" class="layui-input" name="sort" autocomplete="off" value="{$info.sort}" lay-verify="required|number" placeholder="请输入排序">
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label">提示</label>
							<div class="layui-input-inline">
								<textarea name="tips" class="layui-textarea" placeholder="请输入提示信息">{$info.tips}</textarea>
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label">是否必填</label>
							<div class="layui-input-inline">
								<input type="radio" name="is_required" value="1" title="是" {if $info.is_required == 1} checked {/if}>
								<input type="radio" name="is_required" value="0" title="否" {if $info.is_required == 0} checked {/if}>
							</div>
						</div>
					{if !in_array($info['field_name'],array('seo_title','seo_keywords','seo_description'))}
						<div class="layui-form-item">
							<label class="layui-form-label">列表显示</label>
							<div class="layui-input-inline">
								<input type="radio" name="is_nav" value="1" title="是" {if $info.is_nav == 1} checked {/if}>
								<input type="radio" name="is_nav" value="0" title="否" {if $info.is_nav == 0} checked {/if}>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">是否搜索</label>
							<div class="layui-input-inline">
								<input type="radio" name="is_search" value="1" title="是" {if $info.is_search == 1} checked {/if}>
								<input type="radio" name="is_search" value="0" title="否" {if $info.is_search == 0} checked {/if}>
							</div>
						</div>
					{else/}
						<input hidden="hidden" name="is_nav" value="0">
						<input hidden="hidden" name="is_search" value="0">
					{/if}
						<div class="layui-form-item">
							<label class="layui-form-label">启用状态</label>
							<div class="layui-input-inline">
								<input type="radio" name="status" value="1" title="开启" {if $info.status == 1} checked {/if}>
								<input type="radio" name="status" value="0" title="关闭" {if $info.status == 0} checked {/if}>
							</div>
						</div>

						<div class="layui-form-item">
							<div class="layui-input-block">
								<input name="id" type="hidden" value="{$info.id}">
								<input name="table_id" type="hidden" value="{$info.table_id}">
								<button class="layui-btn"
									lay-submit
									lay-filter="wy-submit"
									wy-changetabid="contentfield_index"
									wy-closetabid="contentfield_info"
									wy-reloadtable="wy_table_lists"
								>确认提交</button>
								<button type="reset" class="layui-btn layui-btn-primary">重新填写</button>
							</div>
						</div>
					</div>
</form>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
layui.use('form', function(){
  var form = layui.form;
	form.on('select(type)', function(data){
		edit_show_html(data.value);
	});
});
edit_show_html("{$info.type}");
function edit_show_html(_val){
	if(_val == 'radio' || _val == 'select' || _val == 'checkbox'){
		$("#attr_type").show();
	}else{
		$("#attr_type").hide();
	}
}
</script>
</body>